home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 7: Sunsite / Linux Cubed Series 7 - Sunsite Vol 1.iso / system / network / daemons / dns / bind-4.9 / bind-4 / usr / man / man1 / dig.1 next >
Encoding:
Text File  |  1995-08-04  |  16.0 KB  |  397 lines

  1.  
  2.  
  3.  
  4. DIG(1)                                                     DIG(1)
  5.  
  6.  
  7. NNAAMMEE
  8.        dig - send domain name query packets to name servers
  9.  
  10. SSYYNNOOPPSSIISS
  11.        ddiigg   [_@_s_e_r_v_e_r]   _d_o_m_a_i_n   [_<_q_u_e_r_y_-_t_y_p_e_>]  [_<_q_u_e_r_y_-_c_l_a_s_s_>]
  12.        [_+_<_q_u_e_r_y_-_o_p_t_i_o_n_>] [_-_<_d_i_g_-_o_p_t_i_o_n_>] [_%_c_o_m_m_e_n_t]
  13.  
  14. DDEESSCCRRIIPPTTIIOONN
  15.        _D_i_g (domain information groper) is a flexible command line
  16.        tool  which  can  be  used  to gather information from the
  17.        Domain Name System servers.  _D_i_g  has  two  modes:  simple
  18.        interactive  mode  which  makes  a single query, and batch
  19.        which executes a query for each in a list of several query
  20.        lines.  All  query options are accessible from the command
  21.        line.
  22.  
  23.        The usual simple use of _d_i_g will take the form:
  24.  
  25.             dig  @server  domain   query-type  query-class
  26.  
  27.        where:
  28.  
  29.        _s_e_r_v_e_r may be either  a  domain  name  or  a  dot-notation
  30.               Internet  address.  If this optional field is omit-
  31.               ted, _d_i_g will  attempt  to  use  the  default  name
  32.               server for your machine.
  33.  
  34.               NNoottee::  If  a domain name is specified, this will be
  35.               resolved using  the  domain  name  system  resolver
  36.               (i.e.,  BIND). If your system does not support DNS,
  37.               you may _h_a_v_e to  specify  a  dot-notation  address.
  38.               Alternatively,  if  there  is a server at your dis-
  39.               posal somewhere,  all  that  is  required  is  that
  40.               /etc/resolv.conf  be present and indicate where the
  41.               default name  servers   reside,   so  that   _s_e_r_v_e_r
  42.               itself  can be resolved. See _r_e_s_o_l_v_e_r(5) for infor-
  43.               mation  on  /etc/resolv.conf.   (WARNING:  Changing
  44.               /etc/resolv.conf will affect the standard  resolver
  45.               library and  potentially several programs which use
  46.               it.) As an option, the user may set the environment
  47.               variable LOCALRES to name a file  which  is  to  be
  48.               used  instead of /etc/resolv.conf (LOCALRES is spe-
  49.               cific to the _d_i_g resolver and   not  referenced  by
  50.               the standard resolver). If the LOCALRES variable is
  51.               not  set  or  the  file  is   not   readable   then
  52.               /etc/resolv.conf will be used.
  53.  
  54.        _d_o_m_a_i_n is  the  domain  name  for which you are requesting
  55.               information.  See OPTIONS [-x] for  convenient  way
  56.               to specify inverse address query.
  57.  
  58.        _q_u_e_r_y_-_t_y_p_e
  59.               is  the  type  of information (DNS query type) that
  60.               you are requesting. If omitted, the default is  "a"
  61.  
  62.  
  63.  
  64.                          August 30, 1990                        1
  65.  
  66.  
  67.  
  68.  
  69.  
  70. DIG(1)                                                     DIG(1)
  71.  
  72.  
  73.               (T_A  =  address).   The following types are recog-
  74.               nized:
  75.  
  76.               a      T_A      network address
  77.               any    T_ANY    all/any information about specified domain
  78.               mx     T_MX     mail exchanger for the domain
  79.               ns     T_NS     name servers
  80.               soa    T_SOA    zone of authority record
  81.               hinfo  T_HINFO  host information
  82.               axfr   T_AXFR   zone transfer
  83.                                (must ask an authoritative server)
  84.               txt    T_TXT    arbitrary number of strings
  85.  
  86.               (See RFC 1035 for the complete list.)
  87.  
  88.        _q_u_e_r_y_-_c_l_a_s_s
  89.               is the network class requested  in  the  query.  If
  90.               omitted,  the  default  is  "in" (C_IN = Internet).
  91.               The following classes are recognized:
  92.  
  93.               in     C_IN     Internet class domain
  94.               any    C_ANY    all/any class information
  95.  
  96.               (See RFC 1035 for the complete list.)
  97.  
  98.               NNoottee:: "Any" can be used to specify a class and/or a
  99.               type  of query. _D_i_g will parse the first occurrence
  100.               of "any" to mean query-type  =  T_ANY.  To  specify
  101.               query-class  =  C_ANY you must either specify "any"
  102.               twice, or set query-class using  "-c"  option  (see
  103.               below).
  104.  
  105. OOTTHHEERR OOPPTTIIOONNSS
  106.        %ignored-comment
  107.               "%"  is used to included an argument that is simply
  108.               not parsed.  This may be useful  if running _d_i_g  in
  109.               batch  mode.  Instead  of  resolving every @server-
  110.               domain-name in a list of queries, you can avoid the
  111.               overhead  of  doing  so,  and still have the domain
  112.               name on the command line as a reference. Example:
  113.  
  114.                      dig    @128.9.0.32    %venera.isi.edu     mx
  115.               isi.edu
  116.  
  117.  
  118.        -<dig option>
  119.               "-"  is used to specify an option which effects the
  120.               operation of _d_i_g. The following  options  are  cur-
  121.               rently  available  (although  not  guaranteed to be
  122.               useful):
  123.  
  124.               -x _d_o_t_-_n_o_t_a_t_i_o_n_-_a_d_d_r_e_s_s
  125.                      Convenient form to specify  inverse  address
  126.                      mapping.   Instead  of  "dig  32.0.9.128.in-
  127.  
  128.  
  129.  
  130.                          August 30, 1990                        2
  131.  
  132.  
  133.  
  134.  
  135.  
  136. DIG(1)                                                     DIG(1)
  137.  
  138.  
  139.                      addr.arpa"   one   can   simply   "dig    -x
  140.                      128.9.0.32".
  141.  
  142.               -f _f_i_l_e
  143.                      File for _d_i_g batch mode. The file contains a
  144.                      list of query  specifications  (_d_i_g  command
  145.                      lines)  which  are  to  be  executed succes-
  146.                      sively. Lines beginning with  ';',  '#',  or
  147.                      '\n'  are  ignored.  Other options may still
  148.                      appear on  command  line,  and  will  be  in
  149.                      effect for each batch query.
  150.  
  151.               -T _t_i_m_e
  152.                      Time  in seconds between start of successive
  153.                      queries when running in batch mode.  Can  be
  154.                      used  to keep two or more batch _d_i_g commands
  155.                      running roughly in sync. Default is zero.
  156.  
  157.               -p _p_o_r_t
  158.                      Port number. Query a name  server  listening
  159.                      to  a  non-standard  port number. Default is
  160.                      53.
  161.  
  162.               -P[_p_i_n_g_-_s_t_r_i_n_g]
  163.                      After query returns, execute a _p_i_n_g(8)  com-
  164.                      mand  for  response  time  comparison.  This
  165.                      rather  unelegantly  makes  a  call  to  the
  166.                      shell. The last three lines of statistics is
  167.                      printed for the command:
  168.  
  169.                             ping -s server_name 56 3
  170.  
  171.                      If the optional "ping string" is present, it
  172.                      replaces "ping -s" in the shell command.
  173.  
  174.               -t _q_u_e_r_y_-_t_y_p_e
  175.                      Specify type of query. May specify either an
  176.                      integer value to be  included  in  the  type
  177.                      field  or  use  the  abbreviated mnemonic as
  178.                      discussed above (i.e., mx  = T_MX).
  179.  
  180.               -c _q_u_e_r_y_-_c_l_a_s_s
  181.                      Specify class of query. May  specify  either
  182.                      an integer value to be included in the class
  183.                      field or use  the  abbreviated  mnemonic  as
  184.                      discussed above (i.e., in = C_IN).
  185.  
  186.               -envsav
  187.                      This flag specifies that the _d_i_g environment
  188.                      (defaults, print options, etc.),  after  all
  189.                      of the arguments are parsed, should be saved
  190.                      to a file to become the default environment.
  191.                      Useful  if  you do not like the standard set
  192.                      of defaults and do not desire to  include  a
  193.  
  194.  
  195.  
  196.                          August 30, 1990                        3
  197.  
  198.  
  199.  
  200.  
  201.  
  202. DIG(1)                                                     DIG(1)
  203.  
  204.  
  205.                      large  number  of  options  each time _d_i_g is
  206.                      used.  The environment consists of  resolver
  207.                      state  variable  flags, timeout, and retries
  208.                      as well as the flags  detailing  _d_i_g  output
  209.                      (see below).  If the shell environment vari-
  210.                      able LOCALDEF is set to the name of a  file,
  211.                      this is where the default _d_i_g environment is
  212.                      saved. If not, the file "DiG.env" is created
  213.                      in the current working directory.
  214.  
  215.                      NNoottee::   LOCALDEF  is  specific  to  the  _d_i_g
  216.                      resolver, and will not affect  operation  of
  217.                      the standard resolver library.
  218.  
  219.                      Each  time  _d_i_g  is  executed,  it looks for
  220.                      "./DiG.env" or the  file  specified  by  the
  221.                      shell environment variable LOCALDEF. If such
  222.                      file exists and is readable, then the  envi-
  223.                      ronment  is  restored  from this file before
  224.                      any arguments are parsed.
  225.  
  226.               -envset
  227.                      This flag only  affects  batch  query  runs.
  228.                      When  "-envset"  is specified on a line in a
  229.                      _d_i_g batch file, the  _d_i_g  environment  after
  230.                      the   arguments   are  parsed,  becomes  the
  231.                      default environment for the duration of  the
  232.                      batch  file,  or  until  the next line which
  233.                      specifies "-envset".
  234.  
  235.               -[no]stick
  236.                      This flag only affects batch query runs.  It
  237.                      specifies  that the _d_i_g environment (as read
  238.                      initially or set by "-envset" switch) is  to
  239.                      be  restored  before  each query (line) in a
  240.                      _d_i_g  batch  file.   The  default  "-nostick"
  241.                      means  that  the  _d_i_g  environment  does not
  242.                      stick, hence options specified on  a  single
  243.                      line  in  a  _d_i_g  batch  file will remain in
  244.                      effect for subsequent lines (i.e.  they  are
  245.                      not restored to the "sticky" default).
  246.  
  247.  
  248.        +<query option>
  249.               "+"  is  used to specify an option to be changed in
  250.               the query packet or to change _d_i_g output specifics.
  251.               Many  of  these are the same parameters accepted by
  252.               _n_s_l_o_o_k_u_p(8).  If an option  requires  a  parameter,
  253.               the form is as follows:
  254.  
  255.                      +keyword[=value]
  256.  
  257.               Most  keywords  can be abbreviated.  Parsing of the
  258.               "+" options  is very  simplistic --  a  value  must
  259.  
  260.  
  261.  
  262.                          August 30, 1990                        4
  263.  
  264.  
  265.  
  266.  
  267.  
  268. DIG(1)                                                     DIG(1)
  269.  
  270.  
  271.               not  be  separated from its keyword by white space.
  272.               The following keywords are currently available:
  273.  
  274.               Keyword      Abbrev. Meaning [default]
  275.  
  276.               [no]debug    (deb)   turn on/off debugging mode [deb]
  277.               [no]d2               turn on/off extra debugging mode [nod2]
  278.               [no]recurse  (rec)   use/don't use recursive lookup [rec]
  279.               retry=#      (ret)   set number of retries to # [4]
  280.               time=#       (ti)    set timeout length to # seconds [4]
  281.               [no]ko               keep open option (implies vc) [noko]
  282.               [no]vc               use/don't use virtual circuit [novc]
  283.               [no]defname  (def)   use/don't use default domain name [def]
  284.               [no]search   (sea)   use/don't use domain search list [sea]
  285.               domain=NAME  (do)    set default domain name to NAME
  286.               [no]ignore   (i)     ignore/don't ignore trunc. errors [noi]
  287.               [no]primary  (pr)     use/don't use primary server [nopr]
  288.               [no]aaonly   (aa)    authoritative query only flag [noaa]
  289.               [no]sort     (sor)   sort resource records [nosor]
  290.               [no]cmd              echo parsed arguments [cmd]
  291.               [no]stats    (st)    print query statistics [st]
  292.               [no]Header   (H)     print basic header [H]
  293.               [no]header   (he)    print header flags [he]
  294.               [no]ttlid    (tt)    print TTLs [tt]
  295.               [no]cl               print class info [nocl]
  296.               [no]qr               print outgoing query [noqr]
  297.               [no]reply    (rep)   print reply [rep]
  298.               [no]ques     (qu)    print question section [qu]
  299.               [no]answer   (an)    print answer section [an]
  300.               [no]author   (au)    print authoritative section [au]
  301.               [no]addit    (ad)    print additional section [ad]
  302.               pfdef                set to default print flags
  303.               pfmin                set to minimal default print flags
  304.               pfset=#              set print flags to #
  305.                                    (# can be hex/octal/decimal)
  306.               pfand=#              bitwise and print flags with #
  307.               pfor=#               bitwise or print flags with #
  308.  
  309.               The retry and time options affect  the  retransmis-
  310.               sion strategy used by resolver library when sending
  311.               datagram queries. The algorithm is as follows:
  312.  
  313.                    for i = 0 to retry - 1
  314.                        for j = 1 to num_servers
  315.                                 send_query
  316.                                 wait((time * (2**i)) / num_servers)
  317.                        end
  318.                    end
  319.  
  320.               (Note:  _d_i_g  always  uses  a   value   of   1   for
  321.               num_servers.)
  322.  
  323. DDEETTAAIILLSS
  324.        _D_i_g  once required a slightly modified version of the BIND
  325.  
  326.  
  327.  
  328.                          August 30, 1990                        5
  329.  
  330.  
  331.  
  332.  
  333.  
  334. DIG(1)                                                     DIG(1)
  335.  
  336.  
  337.        _r_e_s_o_l_v_e_r(3) library.  BIND's resolver has (as of BIND 4.9)
  338.        been  augmented  to  work properly with _D_i_g.  Essentially,
  339.        _D_i_g is a straight-forward (albeit not  pretty)  effort  of
  340.        parsing arguments and setting appropriate parameters.  _D_i_g
  341.        uses   resolver   routines   res_init(),    res_mkquery(),
  342.        res_send() as well as accessing _res structure.
  343.  
  344. FFIILLEESS
  345.        /etc/resolv.conf  initial domain name and name server
  346.                          addresses
  347.  
  348. EENNVVIIRROONNMMEENNTT
  349.        LOCALRES          file to use in place of /etc/resolv.conf
  350.        LOCALDEF          default environment file
  351.  
  352. AAUUTTHHOORR
  353.        Steve Hotz hotz@isi.edu
  354.  
  355. AACCKKNNOOWWLLEEDDGGMMEENNTTSS
  356.        _D_i_g uses functions from  _n_s_l_o_o_k_u_p(8)  authored  by  Andrew
  357.        Cherenson.
  358.  
  359. BBUUGGSS
  360.        _D_i_g  has  a  serious  case  of "creeping featurism" -- the
  361.        result of considering several potential uses  during  it's
  362.        development.   It  would  probably benefit from a rigorous
  363.        diet.  Similarly, the print flags and granularity  of  the
  364.        items  they specify make evident their rather ad hoc gene-
  365.        sis.
  366.  
  367.        _D_i_g does not consistently exit  nicely  (with  appropriate
  368.        status)  when  a  problem occurs somewhere in the resolver
  369.        (NOTE: most of the common exit cases are  handled).   This
  370.        is  particularly  annoying when running in batch mode.  If
  371.        it exits abnormally (and is not caught), the entire  batch
  372.        aborts;  when such an event is trapped, _d_i_g simply contin-
  373.        ues with the next query.
  374.  
  375. SSEEEE AALLSSOO
  376.        named(8),  resolver(3),  resolver(5),  nslookup(8)
  377.  
  378.  
  379.  
  380.  
  381.  
  382.  
  383.  
  384.  
  385.  
  386.  
  387.  
  388.  
  389.  
  390.  
  391.  
  392.  
  393.  
  394.                          August 30, 1990                        6
  395.  
  396.  
  397.